package com.lrkj.back.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.lrkj.back.entity.ZsWanglan;
import com.lrkj.back.mapper.ZsWanglanMapper;
import com.lrkj.back.service.ZsWanglanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.cbons.mamisay.parent.db.api.DBInterface;
import cn.com.cbons.mamisay.parent.exception.DBException;
import cn.com.cbons.mamisay.parent.service.base.ParentServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Transactional
@Service("zsWanglanService")
public class ZsSWanglanServiceImpl extends ParentServiceImpl<ZsWanglan> implements ZsWanglanService {
    @Autowired
    private ZsWanglanMapper zsWanglanMapper;

    @Override
    protected DBInterface<ZsWanglan> getDao() throws DBException {
        return zsWanglanMapper;
    }

    @Override
    public PageInfo<ZsWanglan> findAllWanglanList(Map<String, Object> map) throws DBException {
        PageHelper.startPage(Integer.valueOf(map.get("pageNo").toString()),
                Integer.valueOf(map.get("pageSize").toString()));
        List<ZsWanglan> list = zsWanglanMapper.findAllWanglanList(map);
        PageInfo<ZsWanglan> zsWanglan = new PageInfo<ZsWanglan>(list);
        return zsWanglan;
    }

    @Override
    public List<ZsWanglan> findAllWanglanList() throws DBException {
        Map<String, Object> map = new HashMap<String, Object>();
        return zsWanglanMapper.findAllWanglanList(map);
    }

    @Override
    public void deleteByWanglanTiaoma(String wlTiaoma) throws DBException {
        zsWanglanMapper.deleteByPrimaryKey(wlTiaoma);
    }

    @Override
    public List<ZsWanglan> findMiejunWanglanList(Map<String, Object> map) throws DBException {
        return zsWanglanMapper.findMiejunWanglanList(map);
    }

    @Override
    public List<ZsWanglan> findWanglanByStateAndType(Map<String, Object> map) throws DBException {
        return zsWanglanMapper.findWanglanByStateAndType(map);
    }

    @Override
    public List<ZsWanglan> findWanglanListByNoPage(Map<String, Object> map) throws DBException {
        return zsWanglanMapper.findWanglanListByNoPage(map);
    }

    @Override
    public ZsWanglan findByWanglanTiaoma(String wlTiaoma) throws DBException {

        return zsWanglanMapper.selectByPrimaryKey(wlTiaoma);
    }

    @Override
    public ZsWanglan findwlCanMiejun(Map<String, Object> map) throws DBException {
        return zsWanglanMapper.findwlCanMiejun(map);
    }

    @Override
    public int updateBatch(List<ZsWanglan> list) throws DBException {
        return zsWanglanMapper.updateBatch(list);
    }

}
